﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

//CC NH: Maybe move this into FishServer.Core with the other extension methods.
namespace FishServe.Core.Services.UpdaterService.Common
{

	public class Guard
	{
		public static void AssertFileExists(string fullPath)
		{
			if (!File.Exists(fullPath))
				throw new AssertionFailedException("File not found: {0}", fullPath);
		}
	}


	public class AssertionFailedException : Exception
	{
		public AssertionFailedException()
			: base("Assertion Failed")
		{
		}

		public AssertionFailedException(string errorMsg)
			: base(errorMsg)
		{
		}

		public AssertionFailedException(string format, params object[] args ): 
			base(string.Format(format, args))
		{
		}
	}
	
}
